package com.ikan.positionserver.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.ikan.positionserver.exceldo.CloudHostDO;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;

import java.util.List;

@Slf4j
@Data
public class CloudHostListener extends AnalysisEventListener<CloudHostDO> {
    private List<CloudHostDO> cloudHostDOList = Lists.newArrayList();

    @Override
    public void invoke(CloudHostDO cloudHostDO, AnalysisContext analysisContext) {
        this.cloudHostDOList.add(cloudHostDO);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("解析运营端云主机完毕");
    }
}
